<?php
defined('_XR_EXEC') or die();
/**
 * 逻辑处理类 admin
 */
class Member_Model extends Model
{ 
	/* 得到当前登录的会员信息 */
	public function getuserinfo(){
		return isset($_SESSION['sys_user'])?$_SESSION['sys_user']:false;
	}
	/* 得到当前登录的用户ID */
	public function getuserid(){ 
		return isset($_SESSION['sys_user'])?$_SESSION['sys_user']['id']:0;
	}
	/* 得到当前登录的会员编号 */
	public function getusername(){ 
		return isset($_SESSION['sys_user']['username'])?$_SESSION['sys_user']['username']:'';
	}
	/* 得到姓名 */
	public function getname(){ 
		if(isset($_SESSION['sys_user'])){
			if($_SESSION['sys_user']['name'] != ''){
				return $_SESSION['sys_user']['name'];
			}else{
				return $_SESSION['sys_user']['username'];
			}
		}else{
			return '';
		}	
	}
	/* 得到简化的姓名 */
	public function getname_short(){
		return Func::strWidth($this->getname(),0,12);
	}
	/* 得到当前登录会员配送类别 */
	public function getusersendtype(){
		$info = $this->getuserinfo();
		if($info === false){
			return false;
		}
		return $info['sendtype'];
	}
	 
	 
	 
	public function get_logincount(){  
			return $_SESSION['sys_user']['login_count'] ;
	 
	}
	public function get_loginip(){  
			return $_SESSION['sys_user']['login_ip'] ;
	 
	}
 
	
	  
	
  
}

?>